using Avalonia;
using Avalonia.Controls;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Share.Core.Utils;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace GetStartedApp.ViewModel.Page
{
    public partial class SelectedFilesViewModel : ViewModelBase
    {
        /// <summary>
        /// Gets or sets a list of Files
        /// </summary>
        [ObservableProperty]
        private IEnumerable<string>? _selectedFiles;

        /// <summary>
        /// A command used to select some files
        /// </summary>
        [RelayCommand]
        private async Task SelectFilesAsync()
        {
            SelectedFiles = await DialogHelper.OpenFileDialogAsync(this, "Hello Avalonia");
        }

        // public async void SelectFolderAsync()
        // {
        //     var dialog = new OpenFolderDialog()
        //                  {
        //                      Title = "Select Folder...", Directory = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
        //                  };
        //
        //     var result = await dialog.ShowAsync(Application.Current.MainWindow);
        //     if (result == null)
        //     {
        //         ClickStatusUpdate = "User canceled request";
        //     }
        //     else
        //     {
        //         ClickStatusUpdate = $"User Selected: {result}";
        //     }
        // }
    }
}